#include <iostream>

#include "contacts.pb.h"
#include "contacts.pb.cc"
int main()
{
    contacts::contact conn;
    conn.set_sn(251);
    conn.set_name("坤坤");
    conn.set_score(91);

    std::string str = conn.SerializeAsString();

    contacts::contact stu;
    int n = stu.ParseFromString(str);
    if(n == -1){
        std::cout << "获取失败"<<std::endl;
    }
    else{
        std::cout << stu.sn() << std::endl;
        std::cout << stu.name() << std::endl;
        std::cout << stu.score() << std::endl;
    }

    return 0;
}